import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import dts from "vite-plugin-dts";

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue(), dts({ rollupTypes: true, tsconfigPath: './tsconfig.app.json' })],
  build: {
    lib: {
      entry: {
        index: 'lib/index.ts',
      },
      fileName: (_, entryName) => `${entryName}.js`,
      cssFileName: 'style',
      formats: ['es'],
    },
    rollupOptions: {
      external: ['vue'],
    },
  },
})
